/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.stop.risk.alarm.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.stop.common.constant.enums.ParkStopModDictEnum;
import com.hopes.bizz.stop.common.constant.enums.ParkStopSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 断网报警
 *
 * @author pig
 * @date 2024-02-22 17:30:57
 */
@Data
@TableName("line_alarm_broken")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "断网报警")
public class LineAlarmBrokenEntity extends LineAlarmEntity {

    private static final long serialVersionUID = 1L;


	/**
	* id
	*/
    @Schema(description="id")
	@TableId(type = IdType.ASSIGN_ID)
    private Long id;

	/**
	* 运维单位
	*/
    @Schema(description="运维单位")
    private Long operationId;

	/**
	* 监控点
	*/
    @Schema(description="监控点")
    private Long monitorSiteId;

	/**
	* 报警类型
	*/
    @Schema(description="报警类型")
    private Integer alarmType;

	/**
	* 报警时间
	*/
    @Schema(description="报警时间")
    private Date alarmTime;

	/**
	* 解除时间
	*/
    @Schema(description="解除时间")
    private Date removeTime;

	/**
	* 持续时间
	*/
    @Schema(description="持续时间")
    private Integer durationTime;

	/**
	* 报警状态
	*/
    @Schema(description="报警状态")
    private Integer alarmStatus;

	/**
	* 报警内容
	*/
    @Schema(description="报警内容")
    private String alarmContent;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	public String getMonitorSiteIdStr() {
		return DictResolver.getItemLabelByValue(ParkStopModDictEnum.monitor_site, this.monitorSiteId);
	}

	public String getAlarmStatusStr() {
		return DictResolver.getItemLabelByValue(ParkStopSysDictEnum.alarm_status, this.alarmStatus);
	}

	public String getHandleStatusStr() {
		return DictResolver.getItemLabelByValue(ParkStopSysDictEnum.alarm_handle_status, this.getHandleStatus());
	}

	public String getHandleResultStr() {
		return DictResolver.getItemLabelByValue(ParkStopSysDictEnum.hazard_alarm_handle_result, this.getHandleResult());
	}

}
